package com.iscas.loadstorm.isloadstorm.domain;

import com.iscas.loadstorm.isloadstorm.collector.CustomResultCollector;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.apache.jmeter.engine.StandardJMeterEngine;

@Data
@AllArgsConstructor
public class TestRun {
    private  String testId;
    private  StandardJMeterEngine engine;
    private  CustomResultCollector resultCollector;
    private int samples;
    private int errors;

    public TestRun(String testId, StandardJMeterEngine engine, CustomResultCollector resultCollector) {
        this.testId = testId;
        this.engine = engine;
        this.resultCollector = resultCollector;
        this.samples = 0;
        this.errors = 0;
    }

    public synchronized void incrementSamples() {
        samples++;
    }

    public synchronized void incrementErrors() {
        errors++;
    }

    public int getSamples() {
        return samples;
    }

    public int getErrors() {
        return errors;
    }

}